import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import HomeView from "../views/HomeView.vue";
import "@/assets/iconfont.css";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },

  {
    path: "/SearchSug",
    name: "SearchSug",
    component: () =>
      import(/* webpackChunkName: "SearchSug" */ "../views/SearchSug.vue"),
  },
  {
    path: "/Search",
    name: "Search",
    component: () =>
      import(/* webpackChunkName: "VueSearch" */ "../views/Search.vue"),
  },

  {
    path: "/SortView",
    name: "SortView",
    component: () =>
      import(/* webpackChunkName: "SortView" */ "../views/SortView.vue"),
  },
  {
    path: "/ShoppingCart",
    name: "ShoppingCart",
    component: () =>
      import(/* webpackChunkName: "ShoppingCart" */ "../views/ShoppingCart.vue"),
  },
  {
    path: "/MyView",
    name: "MyView",
    component: () =>
      import(/* webpackChunkName: "MyView" */ "../views/MyView.vue"),
  },







  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
